/*
 * DisjointMultipath.java
 *
 * @created Mercredi 04/04/07
 *
 * @author bbrison
 */

package communication.thirdLayer;

import java.util.*;
import kernel.*;
import objects.*;
import communication.*;

public class DisjointMultipath extends SensorRouting {
    
    public DisjointMultipath(SensorSimulator sim) {
	super(sim, SensorRouting.DISJOINT);
    }
    
    public void packagesTreatment(){
	for(Router current : network) {
	    LinkedList<IdentifiedCurrentPackage> packages = (this.getMySim().getCommunicationManager()
							     .getTLManager().getCurrentPackages()).myPackages(current.getStation());
	    
	    for (int j = 0; j < packages.size(); j++) {
		IdentifiedCurrentPackage cr = packages.removeFirst();
		if (!cr.isReceiver()) {
		    current.packageTreatment(cr.getCurrentPackage(), cr.getCurrentStation());
		}
	    }
	}
    }
    public void routesMaintenance(){}
    public void failedCommunicationTreatment(WishedEmission we){}
   
    
    
}
